bitkeeper revision 1.994.1.4 (40d80db0ELJvAwrBu8alZswoyKyPpw)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 22 Jun 2004 10:45:04 +0000 (10:45 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Tue, 22 Jun 2004 10:45:04 +0000 (10:45 +0000)
Rename dom-control and scheduling interfaces for sanity and consistency.

34 files changed:
extras/mini-os/h/hypervisor.h
linux-2.4.26-xen-sparse/arch/xen/kernel/setup.c
linux-2.4.26-xen-sparse/include/asm-xen/hypervisor.h
tools/examples/xc_dom_control.py
tools/examples/xc_dom_create.py
tools/examples/xm_dom_control.py
tools/examples/xm_dom_create.py
tools/xc/lib/xc.h
tools/xc/lib/xc_domain.c
tools/xc/lib/xc_linux_build.c
tools/xc/lib/xc_linux_restore.c
tools/xc/lib/xc_linux_save.c
tools/xc/lib/xc_netbsd_build.c
tools/xc/lib/xc_private.c
tools/xc/lib/xc_private.h
tools/xc/py/Xc.c
tools/xend/lib/domain_controller.h
tools/xenmgr/lib/EventTypes.py
tools/xenmgr/lib/XendClient.py
tools/xenmgr/lib/XendDomain.py
tools/xenmgr/lib/XendDomainInfo.py
tools/xenmgr/lib/server/SrvDomain.py
tools/xenmgr/lib/xm/create.py
tools/xenmgr/lib/xm/main.py
xen/arch/x86/process.c
xen/common/debug.c
xen/common/dom0_ops.c
xen/common/domain.c
xen/common/kernel.c
xen/common/schedule.c
xen/common/shadow.c
xen/include/hypervisor-ifs/dom0_ops.h
xen/include/hypervisor-ifs/hypervisor-if.h
xen/include/xen/sched.h

index b77e1fa1708789afdb8a3c404c623a444eb24795..e44c6b35731c7565083132ffd84c47e28cf014e2 100644 (file)
@@ -148,7 +148,7 @@ static inline int HYPERVISOR_shutdown(void)
     __asm__ __volatile__ (
         TRAP_INSTR
         : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
-        "b" (SCHEDOP_suspend | (STOPCODE_shutdown << SCHEDOP_reasonshift))
+        "b" (SCHEDOP_shutdown | (SHUTDOWN_poweroff << SCHEDOP_reasonshift))
         : "memory" );
 
     return ret;
@@ -160,7 +160,7 @@ static inline int HYPERVISOR_reboot(void)
     __asm__ __volatile__ (
         TRAP_INSTR
         : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
-        "b" (SCHEDOP_suspend | (STOPCODE_reboot << SCHEDOP_reasonshift))
+        "b" (SCHEDOP_shutdown | (SHUTDOWN_reboot << SCHEDOP_reasonshift))
         : "memory" );
 
     return ret;
@@ -173,7 +173,7 @@ static inline int HYPERVISOR_suspend(unsigned long srec)
     __asm__ __volatile__ (
         TRAP_INSTR
         : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
-        "b" (SCHEDOP_suspend | (STOPCODE_suspend << SCHEDOP_reasonshift)), 
+        "b" (SCHEDOP_shutdown | (SHUTDOWN_suspend << SCHEDOP_reasonshift)), 
         "S" (srec) : "memory" );
 
     return ret;
index a70897c57e76f070e99599133384d81e27d48f75..b329632b789598f01a062aaa5b18e7b99e29de35 100644 (file)
@@ -1142,26 +1142,6 @@ void __init cpu_init (void)
 }
 
 
-/******************************************************************************
- * Time-to-die callback handling.
- */
-
-static void shutdown_handler(ctrl_msg_t *msg, unsigned long id)
-{
-    extern void ctrl_alt_del(void);
-    ctrl_if_send_response(msg);
-    ctrl_alt_del();
-}
-
-static int __init setup_shutdown_event(void)
-{
-    ctrl_if_register_receiver(CMSG_SHUTDOWN, shutdown_handler, 0);
-    return 0;
-}
-
-__initcall(setup_shutdown_event);
-
-
 /******************************************************************************
  * Stop/pickle callback handling.
  */
@@ -1294,9 +1274,15 @@ static void suspend_task(void *unused)
 
 static struct tq_struct suspend_tq;
 
-static void suspend_handler(ctrl_msg_t *msg, unsigned long id)
+static void shutdown_handler(ctrl_msg_t *msg, unsigned long id)
 {
-    if ( !suspending )
+    if ( msg->subtype != CMSG_SHUTDOWN_SUSPEND )
+    {
+        extern void ctrl_alt_del(void);
+        ctrl_if_send_response(msg);
+        ctrl_alt_del();
+    }
+    else if ( !suspending )
     {
        suspending = 1;
        suspend_tq.routine = suspend_task;
@@ -1310,10 +1296,10 @@ static void suspend_handler(ctrl_msg_t *msg, unsigned long id)
     ctrl_if_send_response(msg);
 }
 
-static int __init setup_suspend_event(void)
+static int __init setup_shutdown_event(void)
 {
-    ctrl_if_register_receiver(CMSG_SUSPEND, suspend_handler, 0);
+    ctrl_if_register_receiver(CMSG_SHUTDOWN, shutdown_handler, 0);
     return 0;
 }
 
-__initcall(setup_suspend_event);
+__initcall(setup_shutdown_event);
index 23392a8f1622e91191d8b4021f30559f85d45e1e..18051de97cf2b88084647971e6becc4763a0d1c1 100644 (file)
@@ -248,7 +248,7 @@ static inline int HYPERVISOR_shutdown(void)
     __asm__ __volatile__ (
         TRAP_INSTR
         : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
-        "b" (SCHEDOP_suspend | (STOPCODE_shutdown << SCHEDOP_reasonshift))
+        "b" (SCHEDOP_shutdown | (SHUTDOWN_poweroff << SCHEDOP_reasonshift))
         : "memory" );
 
     return ret;
@@ -260,7 +260,7 @@ static inline int HYPERVISOR_reboot(void)
     __asm__ __volatile__ (
         TRAP_INSTR
         : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
-        "b" (SCHEDOP_suspend | (STOPCODE_reboot << SCHEDOP_reasonshift))
+        "b" (SCHEDOP_shutdown | (SHUTDOWN_reboot << SCHEDOP_reasonshift))
         : "memory" );
 
     return ret;
@@ -273,7 +273,7 @@ static inline int HYPERVISOR_suspend(unsigned long srec)
     __asm__ __volatile__ (
         TRAP_INSTR
         : "=a" (ret) : "0" (__HYPERVISOR_sched_op),
-        "b" (SCHEDOP_suspend | (STOPCODE_suspend << SCHEDOP_reasonshift)), 
+        "b" (SCHEDOP_shutdown | (SHUTDOWN_suspend << SCHEDOP_reasonshift)), 
         "S" (srec) : "memory" );
 
     return ret;
index 5f74077b12bcf0a0e449d8b9c886b08db1d3cf7a..583d629c7442986ccbe6e6990246f8eb5a8c9e87 100755 (executable)
@@ -9,8 +9,8 @@ def usage ():
     print >>sys.stderr, """
 Usage: %s [command] <params>
 
-  stop      [dom]        -- pause a domain
-  start     [dom]        -- un-pause a domain
+  pause     [dom]        -- pause a domain
+  unpause   [dom]        -- un-pause a domain
   shutdown  [dom] [[-w]] -- request a domain to shutdown (can specify 'all')
                             (optionally wait for complete shutdown)
   destroy   [dom]        -- immediately terminate a domain
@@ -45,21 +45,21 @@ dom = None
 if len( sys.argv ) > 2 and re.match('\d+$', sys.argv[2]):
     dom = int(sys.argv[2])
 
-if cmd == 'stop':
-    rc = xc.domain_stop( dom=dom )
+if cmd == 'pause':
+    rc = xc.domain_pause( dom=dom )
 
-elif cmd == 'start':
-    rc = xc.domain_start( dom=dom )    
+elif cmd == 'unpause':
+    rc = xc.domain_unpause( dom=dom )    
 
 elif cmd == 'shutdown':
     list = []
     if dom != None:
-        rc = xc.domain_destroy( dom=dom, force=0 )
+        rc = xc.domain_destroy( dom=dom ) # should be CMSG_SHUTDOWN
         list.append(dom)
     elif sys.argv[2] == 'all':
         for i in xc.domain_getinfo():
             if i['dom'] != 0: # don't shutdown dom0!
-                ret = xc.domain_destroy( dom=i['dom'], force=0 )
+                ret = xc.domain_destroy( dom=i['dom'] ) # should be CMSG_SHUTDOWN
                 if ret !=0: rc = ret
                 else: list.append(i['dom'])
 
@@ -72,7 +72,7 @@ elif cmd == 'shutdown':
                 time.sleep(1)
 
 elif cmd == 'destroy':
-    rc = xc.domain_destroy( dom=dom, force=1 )    
+    rc = xc.domain_destroy( dom=dom )    
 
 elif cmd == 'pincpu':
 
@@ -90,8 +90,8 @@ elif cmd == 'list':
 
        run   = (domain['running'] and 'r') or '-'
         block = (domain['blocked'] and 'b') or '-'
-       stop  = (domain['stopped'] and 's') or '-'
-       susp  = (domain['suspended'] and 'S') or '-'
+       stop  = (domain['paused']  and 'p') or '-'
+       susp  = (domain['shutdown'] and 's') or '-'
        crash = (domain['crashed'] and 'c') or '-'
 
         domain['state'] = run + block + stop + susp + crash
index 0b4ede858371a1d07b1276caa5f5b0bb671b079c..bb3f441894a9af8f3d5ae2a58b98b5ef72ccebe2 100755 (executable)
@@ -364,7 +364,7 @@ def make_domain():
        if not nlb: print >>open('/proc/sys/net/ipv4/ip_nonlocal_bind','w'), '0'
 
     if not dontstart:
-        if xc.domain_start( dom=id ) < 0:
+        if xc.domain_unpause( dom=id ) < 0:
             print "Error starting domain"
             xc.domain_destroy ( dom=id )
             sys.exit()
index d098ee4a2479e85f2e07b890fbf31bfbe9cf991a..0cb9b100afc978eb1d43f3ddb5ae686295f64a70 100755 (executable)
@@ -25,8 +25,8 @@ def usage (rc=0):
 Usage: %s [command] <params>
 
   help                   -- print usage
-  stop      [dom]        -- pause a domain
-  start     [dom]        -- un-pause a domain
+  pause     [dom]        -- pause a domain
+  unpause   [dom]        -- un-pause a domain
   shutdown  [dom] [[-w]] -- request a domain to shutdown (can specify 'all')
                             (optionally wait for complete shutdown)
   destroy   [dom]        -- immediately terminate a domain
@@ -89,11 +89,11 @@ if len( sys.argv ) > 2 and re.match('\d+$', sys.argv[2]):
 if cmd == "help":
     usage()
     
-elif cmd == 'stop':
-    rc = server.xend_domain_stop(dom)
+elif cmd == 'pause':
+    rc = server.xend_domain_pause(dom)
 
-elif cmd == 'start':
-    rc = server.xend_domain_start(dom)    
+elif cmd == 'unpause':
+    rc = server.xend_domain_unpause(dom)    
 
 elif cmd == 'shutdown':
     doms = []
index 6c2f9674a77c39fdd7571c15b136681389fe2048..d84efb1c92caa6e55a2432f64df8f993ae7d6234 100755 (executable)
@@ -305,7 +305,7 @@ def make_domain(config):
     else:
         console_port = None
     
-    if server.xend_domain_start(dom) < 0:
+    if server.xend_domain_unpause(dom) < 0:
         print "Error starting domain"
         server.xend_domain_halt(dom)
         sys.exit()
index 1ca7ead8d0c4377574181d91f7a1194abcfe8aa7..4e75ebebef9e430ffca72d39847753fcdb04e2bb 100644 (file)
@@ -25,8 +25,8 @@ int xc_interface_close(int xc_handle);
 typedef struct {
     u32           domid;
     unsigned int  cpu;
-    unsigned int  dying:1, crashed:1, suspended:1, 
-                  stopped:1, blocked:1, running:1;
+    unsigned int  dying:1, crashed:1, shutdown:1, 
+                  paused:1, blocked:1, running:1;
     unsigned long nr_pages;
     unsigned long shared_info_frame;
     u64           cpu_time;
@@ -40,13 +40,12 @@ int xc_domain_create(int xc_handle,
                      const char *name,
                     int cpu,
                      u32 *pdomid);
-int xc_domain_start(int xc_handle, 
+int xc_domain_pause(int xc_handle, 
                     u32 domid);
-int xc_domain_stop(int xc_handle, 
-                   u32 domid);
+int xc_domain_unpause(int xc_handle, 
+                      u32 domid);
 int xc_domain_destroy(int xc_handle, 
-                      u32 domid, 
-                      int force);
+                      u32 domid);
 int xc_domain_pincpu(int xc_handle,
                      u32 domid,
                      int cpu);
index a0e222718d78679548ac79b8b57d813eecc006f9..84a97ce67960fc0681c0c613a1e1071594172e0a 100644 (file)
@@ -30,34 +30,32 @@ int xc_domain_create(int xc_handle,
 }    
 
 
-int xc_domain_start(int xc_handle,
+int xc_domain_pause(int xc_handle, 
                     u32 domid)
 {
     dom0_op_t op;
-    op.cmd = DOM0_STARTDOMAIN;
-    op.u.startdomain.domain = (domid_t)domid;
+    op.cmd = DOM0_PAUSEDOMAIN;
+    op.u.pausedomain.domain = (domid_t)domid;
     return do_dom0_op(xc_handle, &op);
 }    
 
 
-int xc_domain_stop(int xc_handle, 
-                   u32 domid)
+int xc_domain_unpause(int xc_handle,
+                      u32 domid)
 {
     dom0_op_t op;
-    op.cmd = DOM0_STOPDOMAIN;
-    op.u.stopdomain.domain = (domid_t)domid;
+    op.cmd = DOM0_UNPAUSEDOMAIN;
+    op.u.unpausedomain.domain = (domid_t)domid;
     return do_dom0_op(xc_handle, &op);
 }    
 
 
 int xc_domain_destroy(int xc_handle,
-                      u32 domid, 
-                      int force)
+                      u32 domid)
 {
     dom0_op_t op;
     op.cmd = DOM0_DESTROYDOMAIN;
     op.u.destroydomain.domain = (domid_t)domid;
-    op.u.destroydomain.force  = !!force;
     return do_dom0_op(xc_handle, &op);
 }
 
@@ -94,12 +92,12 @@ int xc_domain_getinfo(int xc_handle,
         info->cpu     =
             (op.u.getdomaininfo.flags>>DOMFLAGS_CPUSHIFT) & DOMFLAGS_CPUMASK;
 
-        info->dying     = (op.u.getdomaininfo.flags & DOMFLAGS_DYING);
-        info->crashed   = (op.u.getdomaininfo.flags & DOMFLAGS_CRASHED);
-        info->suspended = (op.u.getdomaininfo.flags & DOMFLAGS_SUSPENDED);
-        info->stopped   = (op.u.getdomaininfo.flags & DOMFLAGS_STOPPED);
-        info->blocked   = (op.u.getdomaininfo.flags & DOMFLAGS_BLOCKED);
-        info->running   = (op.u.getdomaininfo.flags & DOMFLAGS_RUNNING);
+        info->dying    = (op.u.getdomaininfo.flags & DOMFLAGS_DYING);
+        info->crashed  = (op.u.getdomaininfo.flags & DOMFLAGS_CRASHED);
+        info->shutdown = (op.u.getdomaininfo.flags & DOMFLAGS_SHUTDOWN);
+        info->paused   = (op.u.getdomaininfo.flags & DOMFLAGS_PAUSED);
+        info->blocked  = (op.u.getdomaininfo.flags & DOMFLAGS_BLOCKED);
+        info->running  = (op.u.getdomaininfo.flags & DOMFLAGS_RUNNING);
 
         info->nr_pages = op.u.getdomaininfo.tot_pages;
         info->max_memkb = op.u.getdomaininfo.max_pages<<(PAGE_SHIFT-10);
index 16d0dbb9d1ab017afb73e2f1c10f689933d583e6..ceace01b00167bbd95ad0cb4c29f249df96b96fe 100644 (file)
@@ -436,7 +436,7 @@ int xc_linux_build(int xc_handle,
         PERROR("Could not get info on domain");
         goto error_out;
     }
-    if ( !(op.u.getdomaininfo.flags & DOMFLAGS_STOPPED) ||
+    if ( !(op.u.getdomaininfo.flags & DOMFLAGS_PAUSED) ||
          (ctxt->pt_base != 0) )
     {
         ERROR("Domain is already constructed");
index 5900919e32ac4d0726821d76a21e30e343b1762b..7387cddcf0214cfae5b6e6e946a24c56cd9e366b 100644 (file)
@@ -606,13 +606,8 @@ int xc_linux_restore(int xc_handle,
 
 
  out:
-    if ( rc != 0 )
-    {
-        if ( dom != 0 )
-        {
-            xc_domain_destroy( xc_handle, dom, 1 );
-        }
-    }
+    if ( (rc != 0) && (dom != 0) )
+        xc_domain_destroy(xc_handle, dom);
 
     if ( mmu != NULL )
         free(mmu);
index 35fe92f32d7136ba21901f8d7e6178c4ed86dea3..2d035ff7ea973d8e816d09048a9fddf8e296c2e3 100644 (file)
@@ -273,10 +273,9 @@ int xc_linux_save(int xc_handle,
     }
 
     /* Ensure that the domain exists, and that it is stopped. */
-
-    if ( xc_domain_stop_sync( xc_handle, domid, &op, &ctxt ) )
+    if ( xc_domain_pause(xc_handle, domid) )
     {
-        PERROR("Could not sync stop domain");
+        PERROR("Could not pause domain");
         goto out;
     }
 
@@ -381,9 +380,9 @@ int xc_linux_save(int xc_handle,
             goto out;
         }
 
-        if ( xc_domain_start( xc_handle, domid ) < 0 )
+        if ( xc_domain_unpause(xc_handle, domid) < 0 )
         {
-            ERROR("Couldn't restart domain");
+            ERROR("Couldn't unpause domain");
             goto out;
         }
 
@@ -754,8 +753,7 @@ int xc_linux_save(int xc_handle,
                 DPRINTF("Start last iteration\n");
                 last_iter = 1;
 
-                xc_domain_stop_sync( xc_handle, domid, &op, NULL );
-
+                xc_domain_pause(xc_handle, domid);
             } 
 
             if ( xc_shadow_control( xc_handle, domid, 
index a0c73fa1bc3b78b158d85bb1954b1239b4d141e0..04a47b5068b44df57e957374cbf7ea9dad0078ad 100644 (file)
@@ -258,7 +258,7 @@ int xc_netbsd_build(int xc_handle,
         PERROR("Could not get info on domain");
         goto error_out;
     }
-    if ( !(op.u.getdomaininfo.flags & DOMFLAGS_STOPPED) ||
+    if ( !(op.u.getdomaininfo.flags & DOMFLAGS_PAUSED) ||
          (op.u.getdomaininfo.ctxt->pt_base != 0) )
     {
         ERROR("Domain is already constructed");
index ccf5f97299785dd205c418202aa278929ece90a7..344f48254daa74db63c041e705f9bdceabd0f274 100644 (file)
@@ -199,19 +199,6 @@ int finish_mmu_updates(int xc_handle, mmu_t *mmu)
 }
 
 
-/***********************************************************/
-
-/* this function is a hack until we get proper synchronous domain stop */
-
-int xc_domain_stop_sync( int xc_handle, domid_t domid,
-                         dom0_op_t *op, full_execution_context_t *ctxt)
-{
-    op->cmd = DOM0_STOPDOMAIN;
-    op->u.stopdomain.domain = (domid_t)domid;
-    do_dom0_op(xc_handle, op);
-    return 0;
-}
-
 long long  xc_domain_get_cpu_usage( int xc_handle, domid_t domid )
 {
     dom0_op_t op;
@@ -229,8 +216,6 @@ long long  xc_domain_get_cpu_usage( int xc_handle, domid_t domid )
 }
 
 
-/**********************************************************************/
-
 /* This is shared between save and restore, and may generally be useful. */
 unsigned long csum_page (void * page)
 {
index 6602cf7a9f6e6d31576e40dd26b7550244c1ab23..81213cff2178d2f836604bc407e802a5c4ed5638 100644 (file)
@@ -200,11 +200,6 @@ int mfn_mapper_flush_queue(mfn_mapper_t *t);
 void * mfn_mapper_queue_entry(mfn_mapper_t *t, int offset, 
                              unsigned long mfn, int size );
 
-/*********************/
-
-int xc_domain_stop_sync( int xc_handle, domid_t dom, 
-                        dom0_op_t *op, full_execution_context_t *ctxt );
-
 long long  xc_domain_get_cpu_usage( int xc_handle, domid_t domid );
 
 #endif /* __XC_PRIVATE_H__ */
index 2ece932085f8731f6ba928cf1d66f8a9e429b529..343d118bbceca8b17a7487dd53f3305caa1babd1 100644 (file)
@@ -55,7 +55,7 @@ static PyObject *pyxc_domain_create(PyObject *self,
     return PyInt_FromLong(dom);
 }
 
-static PyObject *pyxc_domain_start(PyObject *self,
+static PyObject *pyxc_domain_pause(PyObject *self,
                                    PyObject *args,
                                    PyObject *kwds)
 {
@@ -68,16 +68,16 @@ static PyObject *pyxc_domain_start(PyObject *self,
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i", kwd_list, &dom) )
         return NULL;
 
-    if ( xc_domain_start(xc->xc_handle, dom) != 0 )
+    if ( xc_domain_pause(xc->xc_handle, dom) != 0 )
         return PyErr_SetFromErrno(xc_error);
     
     Py_INCREF(zero);
     return zero;
 }
 
-static PyObject *pyxc_domain_stop(PyObject *self,
-                                  PyObject *args,
-                                  PyObject *kwds)
+static PyObject *pyxc_domain_unpause(PyObject *self,
+                                     PyObject *args,
+                                     PyObject *kwds)
 {
     XcObject *xc = (XcObject *)self;
 
@@ -88,7 +88,7 @@ static PyObject *pyxc_domain_stop(PyObject *self,
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i", kwd_list, &dom) )
         return NULL;
 
-    if ( xc_domain_stop(xc->xc_handle, dom) != 0 )
+    if ( xc_domain_unpause(xc->xc_handle, dom) != 0 )
         return PyErr_SetFromErrno(xc_error);
     
     Py_INCREF(zero);
@@ -102,15 +102,13 @@ static PyObject *pyxc_domain_destroy(PyObject *self,
     XcObject *xc = (XcObject *)self;
 
     u32 dom;
-    int force = 0;
 
-    static char *kwd_list[] = { "dom", "force", NULL };
+    static char *kwd_list[] = { "dom", NULL };
 
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|i", kwd_list, 
-                                      &dom, &force) )
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i", kwd_list, &dom) )
         return NULL;
 
-    if ( xc_domain_destroy(xc->xc_handle, dom, force) != 0 )
+    if ( xc_domain_destroy(xc->xc_handle, dom) != 0 )
         return PyErr_SetFromErrno(xc_error);
     
     Py_INCREF(zero);
@@ -171,8 +169,8 @@ static PyObject *pyxc_domain_getinfo(PyObject *self,
                           "cpu",       info[i].cpu,
                           "dying",     info[i].dying,
                           "crashed",   info[i].crashed,
-                          "suspended", info[i].suspended,
-                          "stopped",   info[i].stopped,
+                          "shutdown",  info[i].shutdown,
+                          "paused",    info[i].paused,
                           "blocked",   info[i].blocked,
                           "running",   info[i].running,
                           "mem_kb",    info[i].nr_pages*4,
@@ -270,7 +268,7 @@ static PyObject *pyxc_linux_save(PyObject *self,
             if ( rc == 0 )
             {
                 printf("Migration succesful -- destroy local copy\n");
-                xc_domain_destroy( xc->xc_handle, dom, 1 );
+                xc_domain_destroy(xc->xc_handle, dom);
                 close(sd);
                 Py_INCREF(zero);
                 return zero;
@@ -281,7 +279,7 @@ static PyObject *pyxc_linux_save(PyObject *self,
 
     serr:
         printf("Migration failed -- restart local copy\n");
-        xc_domain_start( xc->xc_handle, dom );
+        xc_domain_unpause(xc->xc_handle, dom);
         PyErr_SetFromErrno(xc_error);
         if ( sd >= 0 ) close(sd);
         return NULL;
@@ -327,7 +325,7 @@ static PyObject *pyxc_linux_save(PyObject *self,
             /* kill domain. We don't want to do this for checkpointing, but
                if we don't do it here I think people will hurt themselves
                by accident... */
-            xc_domain_destroy( xc->xc_handle, dom, 1 );
+            xc_domain_destroy(xc->xc_handle, dom);
             gzclose(gfd);
             close(fd);
 
@@ -1015,26 +1013,25 @@ static PyMethodDef pyxc_methods[] = {
       " name   [str, '(anon)']: Informative textual name.\n\n"
       "Returns: [int] new domain identifier; -1 on error.\n" },
 
-    { "domain_start", 
-      (PyCFunction)pyxc_domain_start
+    { "domain_pause", 
+      (PyCFunction)pyxc_domain_pause
       METH_VARARGS | METH_KEYWORDS, "\n"
-      "Start execution of a domain.\n"
-      " dom [int]: Identifier of domain to be started.\n\n"
+      "Temporarily pause execution of a domain.\n"
+      " dom [int]: Identifier of domain to be paused.\n\n"
       "Returns: [int] 0 on success; -1 on error.\n" },
 
-    { "domain_stop", 
-      (PyCFunction)pyxc_domain_stop
+    { "domain_unpause", 
+      (PyCFunction)pyxc_domain_unpause
       METH_VARARGS | METH_KEYWORDS, "\n"
-      "Stop execution of a domain.\n"
-      " dom [int]: Identifier of domain to be stopped.\n\n"
+      "(Re)start execution of a domain.\n"
+      " dom [int]: Identifier of domain to be unpaused.\n\n"
       "Returns: [int] 0 on success; -1 on error.\n" },
 
     { "domain_destroy", 
       (PyCFunction)pyxc_domain_destroy, 
       METH_VARARGS | METH_KEYWORDS, "\n"
       "Destroy a domain.\n"
-      " dom   [int]:    Identifier of domain to be destroyed.\n"
-      " force [int, 0]: Bool - force immediate destruction?\n\n"
+      " dom [int]:    Identifier of domain to be destroyed.\n\n"
       "Returns: [int] 0 on success; -1 on error.\n" },
 
     { "domain_pincpu", 
@@ -1059,8 +1056,8 @@ static PyMethodDef pyxc_methods[] = {
       " cpu      [int]:  CPU to which this domain is bound\n"
       " dying    [int]:  Bool - is the domain dying?\n"
       " crashed  [int]:  Bool - has the domain crashed?\n"
-      " suspended[int]:  Bool - has the domain suspended itself?\n"
-      " stopped  [int]:  Bool - is the domain stopped by control software?\n"
+      " shutdown [int]:  Bool - has the domain shut itself down?\n"
+      " paused   [int]:  Bool - is the domain paused by control software?\n"
       " blocked  [int]:  Bool - is the domain blocked waiting for an event?\n"
       " running  [int]:  Bool - is the domain currently running?\n"
       " mem_kb   [int]:  Memory reservation, in kilobytes\n"
index af202b5ec349ca7e6f46bfad3331e964335f0bfc..300426a879c1fbe7cd15bcabbcdb766d5b8eb4fc 100644 (file)
@@ -29,13 +29,13 @@ typedef struct {
 
 
 /*
- * Stop codes for SCHEDOP_suspend. These are opaque to Xen but interpreted by
- * control software to determine appropriate action.
+ * Reason codes for SCHEDOP_shutdown. These are opaque to Xen but may be
+ * interpreted by control software to determine the appropriate action. These 
+ * are only really advisories: the controller can actually do as it likes.
  */
-
-#define STOPCODE_shutdown   0  /* Domain exited normally. Clean up and kill. */
-#define STOPCODE_reboot     1  /* Clean up, kill, and then restart. */
-#define STOPCODE_suspend    2  /* Clean up, save suspend info, kill. */
+#define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
+#define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
+#define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
 
 
 /*
@@ -69,7 +69,6 @@ typedef struct {
 #define CMSG_BLKIF_FE       2  /* Block-device frontend   */
 #define CMSG_NETIF_BE       3  /* Network-device backend  */
 #define CMSG_NETIF_FE       4  /* Network-device frontend */
-#define CMSG_SUSPEND        5  /* Suspend messages        */
 #define CMSG_SHUTDOWN       6  /* Shutdown messages       */
 
 
@@ -518,16 +517,6 @@ typedef struct {
 } PACKED netif_be_driver_status_changed_t; /* 4 bytes */
 
 
-/******************************************************************************
- * SUSPEND DEFINITIONS
- */
-
-/*
- * Subtypes for console messages.
- */
-/* None. */
-
-
 /******************************************************************************
  * CONSOLE DEFINITIONS
  */
@@ -535,9 +524,9 @@ typedef struct {
 /*
  * Subtypes for console messages.
  */
-#define CMSG_SHUTDOWN_HALT      0   /* Shutdown and halt (don't die). */
-#define CMSG_SHUTDOWN_POWEROFF  1   /* 'Poweroff' => clean death.     */
-#define CMSG_SHUTDOWN_REBOOT    2   /* Shutdown and restart.          */
-
+#define CMSG_SHUTDOWN_POWEROFF  0   /* Clean shutdown (SHUTDOWN_poweroff).   */
+#define CMSG_SHUTDOWN_REBOOT    1   /* Clean shutdown (SHUTDOWN_reboot).     */
+#define CMSG_SHUTDOWN_SUSPEND   2   /* Create suspend info, then             */
+                                    /* SHUTDOWN_suspend.                     */
 
 #endif /* __DOMAIN_CONTROLLER_H__ */
index 3d4230e2baf22f243e99050b68e5bfd9867c898c..c8d5e62aa70c35723ff7414852314c34ed312cef 100644 (file)
@@ -5,8 +5,8 @@
 ## xend.domain.destroy: dom, reason:died/crashed
 ## xend.domain.up ?
 
-## xend.domain.start: dom
-## xend.domain.stop: dom
+## xend.domain.unpause: dom
+## xend.domain.pause: dom
 ## xend.domain.shutdown: dom
 ## xend.domain.halt: dom
 
index 76f49f49bd98abe3e6a6da45eaa0d53196c219eb..965633a421cd3b6fe3f24fb233685e4ac0be2afb 100644 (file)
@@ -187,13 +187,13 @@ class Xend:
     def xend_domain(self, id):
         return xend_get(self.domainurl(id))
 
-    def xend_domain_start(self, id):
+    def xend_domain_unpause(self, id):
         return xend_call(self.domainurl(id),
-                         {'op'      : 'start'})
+                         {'op'      : 'unpause'})
 
-    def xend_domain_stop(self, id):
+    def xend_domain_pause(self, id):
         return xend_call(self.domainurl(id),
-                         {'op'      : 'stop'})
+                         {'op'      : 'pause'})
 
     def xend_domain_shutdown(self, id):
         return xend_call(self.domainurl(id),
index 94afe3e87d0d494e77496b9f07e313850078e44a..659292058b2e0859d35cfb2003a80b04fc76af1e 100644 (file)
@@ -188,18 +188,18 @@ class XendDomain:
         self.refresh_domain(id)
         return self.domain[id]
     
-    def domain_start(self, id):
-        """Start domain running.
+    def domain_unpause(self, id):
+        """(Re)start domain running.
         """
         dom = int(id)
-        eserver.inject('xend.domain.start', id)
-        return xc.domain_start(dom=dom)
+        eserver.inject('xend.domain.unpause', id)
+        return xc.domain_unpause(dom=dom)
     
-    def domain_stop(self, id):
-        """Stop domain running.
+    def domain_pause(self, id):
+        """Pause domain execution.
         """
         dom = int(id)
-        return xc.domain_stop(dom=dom)
+        return xc.domain_pause(dom=dom)
     
     def domain_shutdown(self, id):
         """Shutdown domain (nicely).
@@ -208,7 +208,7 @@ class XendDomain:
         if dom <= 0:
             return 0
         eserver.inject('xend.domain.shutdown', id)
-        val = xc.domain_destroy(dom=dom, force=0)
+        val = xc.domain_destroy(dom=dom) # FIXME -- send CMSG_SHUTDOWN
         self.refresh()
         return val
     
@@ -219,7 +219,7 @@ class XendDomain:
         if dom <= 0:
             return 0
         eserver.inject('xend.domain.halt', id)
-        val = xc.domain_destroy(dom=dom, force=1)
+        val = xc.domain_destroy(dom=dom)
         self.refresh()
         return val       
 
@@ -233,7 +233,7 @@ class XendDomain:
         """Save domain state to file, halt domain.
         """
         dom = int(id)
-        self.domain_stop(id)
+        self.domain_pause(id)
         eserver.inject('xend.domain.save', id)
         rc = xc.linux_save(dom=dom, state_file=dst, progress=progress)
         if rc == 0:
index 61a9b21c5a801ac1a17d896954732a3353d21673..c41ac73b50d4bb80b36fb0acbbcefc0840c945b1 100644 (file)
@@ -113,8 +113,8 @@ class XendDomainInfo:
         if self.info:
             run   = (self.info['running'] and 'r') or '-'
             block = (self.info['blocked'] and 'b') or '-'
-            stop  = (self.info['stopped'] and 's') or '-'
-            susp  = (self.info['suspended'] and 'S') or '-'
+            stop  = (self.info['paused']  and 'p') or '-'
+            susp  = (self.info['shutdown'] and 's') or '-'
             crash = (self.info['crashed'] and 'c') or '-'
             state = run + block + stop + susp + crash
             sxpr.append(['cpu', self.info['cpu']])
@@ -172,7 +172,7 @@ class XendDomainInfo:
     def destroy(self):
         if self.dom <= 0:
             return 0
-        return xc.domain_destroy(dom=self.dom, force=1)
+        return xc.domain_destroy(dom=self.dom)
 
     def show(self):
         """Print virtual machine info.
index 0ef56769418ff896362460d3429e85da66e489a7..07d3cfa7dea05fbe20253f0e5b28dfa326352be5 100644 (file)
@@ -18,12 +18,12 @@ class SrvDomain(SrvDir):
         self.xd = XendDomain.instance()
         self.xconsole = XendConsole.instance()
 
-    def op_start(self, op, req):
-        val = self.xd.domain_start(self.dom.id)
+    def op_unpause(self, op, req):
+        val = self.xd.domain_unpause(self.dom.id)
         return val
         
-    def op_stop(self, op, req):
-        val = self.xd.domain_stop(self.dom.id)
+    def op_pause(self, op, req):
+        val = self.xd.domain_pause(self.dom.id)
         return val
 
     def op_shutdown(self, op, req):
index 863227ad4cbfb78c6e1fd1e761a48b51db959b80..4c1804a7ac751ff811beb2375d1571c1404c74b1 100644 (file)
@@ -270,7 +270,7 @@ def make_domain(opts, config):
     else:
         console_port = None
     
-    if server.xend_domain_start(dom) < 0:
+    if server.xend_domain_unpause(dom) < 0:
         server.xend_domain_halt(dom)
         opts.err("Failed to start domain %d" % dom)
     opts.info("Started domain %d, console on port %d"
index 4c70717521961709475cfca6a346e4cfc47214e7..9b2125a7c53c959afae6af1d3798ccb02ee88e6c 100644 (file)
@@ -101,25 +101,25 @@ class Xm:
         """Shutdown a domain."""
         shutdown.main(args)
 
-    def xm_stop(self, help, args):
-        """Stop execution of a domain."""
+    def xm_pause(self, help, args):
+        """Pause execution of a domain."""
         if help:
             print args[0], 'DOM'
-            print '\nStop execution of domain DOM.'
+            print '\nPause execution of domain DOM.'
             return
         if len(args) < 2: self.err("%s: Missing domain" % args[0])
         dom = args[1]
-        server.xend_domain_stop(dom)
+        server.xend_domain_pause(dom)
 
-    def xm_start(self, help, args):
-        """Start execution of a domain."""
+    def xm_unpause(self, help, args):
+        """(Re)start execution of a domain."""
         if help:
             print args[0], 'DOM'
-            print '\nStart execution of domain DOM.'
+            print '\n(Re)start execution of domain DOM.'
             return
         if len(args) < 2: self.err("%s: Missing domain" % args[0])
         dom = args[1]
-        server.xend_domain_start(dom)
+        server.xend_domain_unpause(dom)
 
     def xm_pincpu(self, help, args):
         """Pin a domain to a cpu. """
index dbc7eb2b7a568a83a87450b9554cb58b8532d07e..d3bf5ab4b8db76cf026056fb7165727f201f71bf 100644 (file)
@@ -76,7 +76,7 @@ void startup_cpu_idle_loop(void)
 {
     /* Just some sanity to ensure that the scheduler is set up okay. */
     ASSERT(current->domain == IDLE_DOMAIN_ID);
-    domain_start(current);
+    domain_unpause_by_systemcontroller(current);
     __enter_scheduler();
 
     /*
index ce911bd11f37f6ad36c9901e86deff8ddf4501e3..fd2d7d28c3eebff5d8b128a829b39384972d4a22 100644 (file)
@@ -52,7 +52,7 @@ void pdb_do_debug (dom0_op_t *op)
            struct domain *d = find_domain_by_id(op->u.debug.domain);
            if ( d != NULL )
            {
-                domain_start(d);
+                domain_unpause_by_systemcontroller(d);
                put_domain(d);
            }
            else
@@ -94,7 +94,7 @@ void pdb_do_debug (dom0_op_t *op)
 
            if ( d != NULL )
            {
-                domain_stop(d);
+                domain_pause_by_systemcontroller(d);
                put_domain(d);
            }
            else
index 7af451bfe53df82c733f7d7ffb95550ac75086a6..f999bd45368378869f927bd96f32d1795a9b6372 100644 (file)
@@ -80,16 +80,16 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     }
     break;
 
-    case DOM0_STARTDOMAIN:
+    case DOM0_PAUSEDOMAIN:
     {
-        struct domain *d = find_domain_by_id(op->u.startdomain.domain);
+        struct domain *d = find_domain_by_id(op->u.pausedomain.domain);
         ret = -ESRCH;
         if ( d != NULL )
         {
             ret = -EINVAL;
-            if ( test_bit(DF_CONSTRUCTED, &d->flags) )
+            if ( d != current )
             {
-                domain_start(d);
+                domain_pause_by_systemcontroller(d);
                 ret = 0;
             }
             put_domain(d);
@@ -97,16 +97,16 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     }
     break;
 
-    case DOM0_STOPDOMAIN:
+    case DOM0_UNPAUSEDOMAIN:
     {
-        struct domain *d = find_domain_by_id(op->u.stopdomain.domain);
+        struct domain *d = find_domain_by_id(op->u.unpausedomain.domain);
         ret = -ESRCH;
         if ( d != NULL )
         {
             ret = -EINVAL;
-            if ( d != current )
+            if ( test_bit(DF_CONSTRUCTED, &d->flags) )
             {
-                domain_stop(d);
+                domain_unpause_by_systemcontroller(d);
                 ret = 0;
             }
             put_domain(d);
@@ -299,16 +299,16 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
         strcpy(op->u.getdomaininfo.name, d->name);
         
         op->u.getdomaininfo.flags =
-            (test_bit(DF_DYING,     &d->flags) ? DOMFLAGS_DYING     : 0) |
-            (test_bit(DF_CRASHED,   &d->flags) ? DOMFLAGS_CRASHED   : 0) |
-            (test_bit(DF_SUSPENDED, &d->flags) ? DOMFLAGS_SUSPENDED : 0) |
-            (test_bit(DF_STOPPED,   &d->flags) ? DOMFLAGS_STOPPED   : 0) |
-            (test_bit(DF_BLOCKED,   &d->flags) ? DOMFLAGS_BLOCKED   : 0) |
-            (test_bit(DF_RUNNING,   &d->flags) ? DOMFLAGS_RUNNING   : 0);
+            (test_bit(DF_DYING,     &d->flags) ? DOMFLAGS_DYING    : 0) |
+            (test_bit(DF_CRASHED,   &d->flags) ? DOMFLAGS_CRASHED  : 0) |
+            (test_bit(DF_SHUTDOWN,  &d->flags) ? DOMFLAGS_SHUTDOWN : 0) |
+            (test_bit(DF_CTRLPAUSE, &d->flags) ? DOMFLAGS_PAUSED   : 0) |
+            (test_bit(DF_BLOCKED,   &d->flags) ? DOMFLAGS_BLOCKED  : 0) |
+            (test_bit(DF_RUNNING,   &d->flags) ? DOMFLAGS_RUNNING  : 0);
 
         op->u.getdomaininfo.flags |= d->processor << DOMFLAGS_CPUSHIFT;
         op->u.getdomaininfo.flags |= 
-            d->suspend_code << DOMFLAGS_SUSPCODESHIFT;
+            d->shutdown_code << DOMFLAGS_SHUTDOWNSHIFT;
 
         op->u.getdomaininfo.tot_pages   = d->tot_pages;
         op->u.getdomaininfo.max_pages   = d->max_pages;
index d6a43a474602f80439f462e37a3b7700d4449ef9..97de78159e30ddffcfbd79502eb510fe5d495a09 100644 (file)
@@ -11,6 +11,7 @@
 #include <xen/shadow.h>
 #include <xen/console.h>
 #include <xen/shadow.h>
+#include <xen/irq.h>
 #include <asm/io.h>
 #include <asm/domain_page.h>
 #include <asm/flushtlb.h>
@@ -193,19 +194,19 @@ void domain_crash(void)
     BUG();
 }
 
-void domain_suspend(u8 reason)
+void domain_shutdown(u8 reason)
 {
     struct domain *d;
 
     if ( current->domain == 0 )
     {
         extern void machine_restart(char *);
-        printk("Domain 0 halted: rebooting machine!\n");
+        printk("Domain 0 shutdown: rebooting machine!\n");
         machine_restart(0);
     }
 
-    current->suspend_code = reason;
-    set_bit(DF_SUSPENDED, &current->flags);
+    current->shutdown_code = reason;
+    set_bit(DF_SHUTDOWN, &current->flags);
 
     d = find_domain_by_id(0);
     send_guest_virq(d, VIRQ_DOM_EXC);
index 2b6d1ec021b967de580902a9b2ade830d7562aad..6ff886985a13f4d903b158f72be945aaa85f5cae 100644 (file)
@@ -286,8 +286,8 @@ void cmain(unsigned long magic, multiboot_info_t *mbi)
 
     init_trace_bufs();
 
-    domain_start(current);
-    domain_start(new_dom);
+    domain_unpause_by_systemcontroller(current);
+    domain_unpause_by_systemcontroller(new_dom);
     startup_cpu_idle_loop();
 }
 
index d9cb33fdb5a6d3d677b976fa8c761c0d7f4187f9..a43e725db60e830b9e59f7a44da0437bdf6f0753 100644 (file)
@@ -129,7 +129,8 @@ struct domain *alloc_domain_struct(void)
  */
 void sched_add_domain(struct domain *d) 
 {
-    set_bit(DF_STOPPED, &d->flags);
+    /* Must be unpaused by control software to start execution. */
+    set_bit(DF_CTRLPAUSE, &d->flags);
 
     if ( d->domain != IDLE_DOMAIN_ID )
     {
@@ -269,9 +270,9 @@ long do_sched_op(unsigned long op)
         break;
     }
 
-    case SCHEDOP_suspend:
+    case SCHEDOP_shutdown:
     {
-        domain_suspend((u8)(op >> SCHEDOP_reasonshift));
+        domain_shutdown((u8)(op >> SCHEDOP_reasonshift));
         break;
     }
 
index 8936a6422de2c5bfef763828ac2561d2e1c8b2d4..7b20e57f1d4f1110e624418176f7281e69cc534c 100644 (file)
@@ -417,7 +417,7 @@ static int shadow_mode_table_op(struct domain *d,
 
         /* Might as well stop the domain as an optimization. */
                if ( zero )
-            domain_stop(d);
+            domain_pause_by_systemcontroller(d);
 
                break;
     }
index d1cf9c1fd5d5b004563cfacb8b04e8f376f2a7f2..a1df5cb23ca1ec05b7b9f896bd308ed498876e57 100644 (file)
@@ -19,7 +19,7 @@
  * This makes sure that old versions of dom0 tools will stop working in a
  * well-defined way (rather than crashing the machine, for instance).
  */
-#define DOM0_INTERFACE_VERSION   0xAAAA000F
+#define DOM0_INTERFACE_VERSION   0xAAAA0010
 
 #define MAX_DOMAIN_NAME    16
 
@@ -63,20 +63,19 @@ typedef struct {
 typedef struct {
     /* IN variables. */
     domid_t      domain;              /*  0 */
-    u32          force;               /*  4 */
-} PACKED dom0_destroydomain_t; /* 8 bytes */
+} PACKED dom0_destroydomain_t; /* 4 bytes */
 
-#define DOM0_STARTDOMAIN      10
+#define DOM0_PAUSEDOMAIN      10
 typedef struct {
     /* IN parameters. */
     domid_t domain;                   /*  0 */
-} PACKED dom0_startdomain_t; /* 4 bytes */
+} PACKED dom0_pausedomain_t; /* 4 bytes */
 
-#define DOM0_STOPDOMAIN       11
+#define DOM0_UNPAUSEDOMAIN    11
 typedef struct {
     /* IN parameters. */
     domid_t domain;                   /*  0 */
-} PACKED dom0_stopdomain_t; /* 4 bytes */
+} PACKED dom0_unpausedomain_t; /* 4 bytes */
 
 #define DOM0_GETDOMAININFO    12
 typedef struct {
@@ -85,14 +84,14 @@ typedef struct {
     /* OUT variables. */
 #define DOMFLAGS_DYING     (1<<0) /* Domain is scheduled to die.             */
 #define DOMFLAGS_CRASHED   (1<<1) /* Crashed domain; frozen for postmortem.  */
-#define DOMFLAGS_SUSPENDED (1<<2) /* Domain voluntarily halted it execution. */
-#define DOMFLAGS_STOPPED   (1<<3) /* Currently stopped by control software.  */
+#define DOMFLAGS_SHUTDOWN  (1<<2) /* The guest OS has shut itself down.      */
+#define DOMFLAGS_PAUSED    (1<<3) /* Currently paused by control software.   */
 #define DOMFLAGS_BLOCKED   (1<<4) /* Currently blocked pending an event.     */
 #define DOMFLAGS_RUNNING   (1<<5) /* Domain is currently running.            */
 #define DOMFLAGS_CPUMASK      255 /* CPU to which this domain is bound.      */
 #define DOMFLAGS_CPUSHIFT       8
-#define DOMFLAGS_SUSPCODEMASK 255 /* DOMSTATE_SUSPENDED guest-supplied code. */
-#define DOMFLAGS_SUSPCODESHIFT 16
+#define DOMFLAGS_SHUTDOWNMASK 255 /* DOMFLAGS_SHUTDOWN guest-supplied code.  */
+#define DOMFLAGS_SHUTDOWNSHIFT 16
     u32      flags;                   /*  4 */
     u8       name[MAX_DOMAIN_NAME];   /*  8 */
     full_execution_context_t *ctxt;   /* 24 */ /* NB. IN/OUT variable. */
@@ -319,8 +318,8 @@ typedef struct {
     union {                           /* 8 */
        u32                      dummy[18]; /* 72 bytes */
         dom0_createdomain_t      createdomain;
-        dom0_startdomain_t       startdomain;
-        dom0_stopdomain_t        stopdomain;
+        dom0_pausedomain_t       pausedomain;
+        dom0_unpausedomain_t     unpausedomain;
         dom0_destroydomain_t     destroydomain;
         dom0_getmemlist_t        getmemlist;
         dom0_schedctl_t          schedctl;
index 35a3d4056c842858885438d3566094ad048fb1fa..a8a59eca5b784c579f3aa0fa0ac862e8bd81c9b8 100644 (file)
  */
 #define SCHEDOP_yield           0   /* Give up the CPU voluntarily.       */
 #define SCHEDOP_block           1   /* Block until an event is received.  */
-#define SCHEDOP_suspend         2   /* Stop executing this domain.        */
+#define SCHEDOP_shutdown        2   /* Stop executing this domain.        */
 #define SCHEDOP_cmdmask       255   /* 8-bit command. */
-#define SCHEDOP_reasonshift     8   /* 8-bit suspend code. (SCHEDOP_suspend) */
+#define SCHEDOP_reasonshift     8   /* 8-bit reason code. (SCHEDOP_shutdown) */
 
 /*
  * Commands to HYPERVISOR_console_io().
index 6a223663cabb912e7df25e5d0c541cbb7aa1e292..467a6878f5970e78be9884a30a720b369e05d815 100644 (file)
@@ -96,7 +96,7 @@ struct domain
 
     /* Scheduling. */
     struct list_head run_list;
-    int              suspend_code;  /* code value from OS (if DF_SUSPENDED). */
+    int              shutdown_code; /* code value from OS (if DF_SHUTDOWN). */
     s_time_t         lastschd;      /* time this domain was last scheduled */
     s_time_t         lastdeschd;    /* time this domain was last descheduled */
     s_time_t         cpu_time;      /* total CPU time received till now */
@@ -193,7 +193,7 @@ struct domain *find_last_domain(void);
 extern void domain_destruct(struct domain *d);
 extern void domain_kill(struct domain *d);
 extern void domain_crash(void);
-extern void domain_suspend(u8 reason);
+extern void domain_shutdown(u8 reason);
 
 /* arch/process.c */
 void new_thread(struct domain *d,
@@ -254,8 +254,8 @@ extern struct domain *task_list;
 #define DF_CONSOLEWRITEBUG 6 /* Has this domain used the obsolete console?  */
 #define DF_PHYSDEV      7 /* May this domain do IO to physical devices?     */
 #define DF_BLOCKED      8 /* Domain is blocked waiting for an event.        */
-#define DF_STOPPED      9 /* Domain is stopped by control software.          */
-#define DF_SUSPENDED   10 /* Guest suspended its execution for some reason. */
+#define DF_CTRLPAUSE    9 /* Domain is paused by controller software.       */
+#define DF_SHUTDOWN    10 /* Guest shut itself down for some reason.        */
 #define DF_CRASHED     11 /* Domain crashed inside Xen, cannot continue.    */
 #define DF_DYING       12 /* Death rattle.                                  */
 #define DF_RUNNING     13 /* Currently running on a CPU.                    */
@@ -264,8 +264,8 @@ extern struct domain *task_list;
 static inline int domain_runnable(struct domain *d)
 {
     return ( (atomic_read(&d->pausecnt) == 0) &&
-             !(d->flags & ((1<<DF_BLOCKED)|(1<<DF_STOPPED)|
-                           (1<<DF_SUSPENDED)|(1<<DF_CRASHED))) );
+             !(d->flags & ((1<<DF_BLOCKED)|(1<<DF_CTRLPAUSE)|
+                           (1<<DF_SHUTDOWN)|(1<<DF_CRASHED))) );
 }
 
 static inline void domain_pause(struct domain *d)
@@ -289,24 +289,17 @@ static inline void domain_unblock(struct domain *d)
         domain_wake(d);
 }
 
-static inline void domain_unsuspend(struct domain *d)
+static inline void domain_pause_by_systemcontroller(struct domain *d)
 {
     ASSERT(d != current);
-    if ( test_and_clear_bit(DF_SUSPENDED, &d->flags) )
-        domain_wake(d);
-}
-
-static inline void domain_stop(struct domain *d)
-{
-    ASSERT(d != current);
-    if ( !test_and_set_bit(DF_STOPPED, &d->flags) )
+    if ( !test_and_set_bit(DF_CTRLPAUSE, &d->flags) )
         domain_sleep(d);
 }
 
-static inline void domain_start(struct domain *d)
+static inline void domain_unpause_by_systemcontroller(struct domain *d)
 {
     ASSERT(d != current);
-    if ( test_and_clear_bit(DF_STOPPED, &d->flags) )
+    if ( test_and_clear_bit(DF_CTRLPAUSE, &d->flags) )
         domain_wake(d);
 }